/**********************************************************************
*
*  Source File Name = sample_typedef.h
*
*  (C) COPYRIGHT International Business Machines Corp. 2003,2004
*  All Rights Reserved
*  Licensed Materials - Property of IBM
*
*  US Government Users Restricted Rights - Use, duplication or
*  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*
*  Function = Include File defining:Structures and macros used in sample wrapper
*
*  Operating System = All
*
***********************************************************************/
#ifndef __SAMPLE_TYPEDEFS_H__
#define __SAMPLE_TYPEDEFS_H__

#include "sqlcli.h"


// Wrapper Defines
#define SAMPLE_WRAPPER_TYPE   'N'       // 'N' For Non-Relational (Generic)
#define SAMPLE_WRAPPER_VERSION 1 

// Nickname Defines
#define FILE_PATH_OPTION            "FILE_PATH"

// Misc. Defines
#define NULL_WRAPPER "Cannot get wrapper object"
#define NULL_PATH   "Data source path is NULL"
#define LSTAT_ERROR "STAT Failed on data source"
#define COLUMN_ERROR "No column info found"
#define ACCESS_ERROR "Unable to read file"
#define DATA_ERROR "Data Error"
#define NOT_FILE_ERROR "Data source is a non-standard file"
#define OPEN_ERROR "File open error"
#define BAD_PRED_OP "Unsupported operator"
#define BAD_COLUMN "Column not found"
#define KEY_EXCEEDS_SIZE "Key exceeds definition size"
#define FILE_SIZE_ERROR "Line in data file exceeds 32k"

// Constants
#define MAX_DECIMAL_SIZE    34
#define MAX_VARCHAR_LENGTH  32672

// enums and structs needed by the different classes.

enum  myboolean {NO,YES};


struct    columnData 
{ 
  sqlint32     type;     // This structure is used to
  sqluint8     *name;    // contain the information about
  void         *data;    // a data element
  sqlint32     len;      
  int          precision;  // Used with decimal data type
  int          scale;      // Used with decimal data type
};

enum relOperator
{ 
  SQL_EQ,
  ALL_ROWS
};

// This is a subset of Sample_Query that is generated by plan_request()
struct Sample_Exec_Descriptor
{
  relOperator        mPredOperator;
  int                mNumColumns;
  int                mKeyVector;
  int                mBindIndex;
};

#endif
